// 店铺经营时间规则

import request from '@/utils/request'
import R from '@/types/conduit/R'
import ShopBusinessRules from '@/types/entity/ShopBusinessRules'

export const queryShopBusinessTimeRules = (): Promise<R<ShopBusinessRules[]>> =>
  request({
    url: `/shop/shop-business-rules/shop-rules`,
    method: 'GET'
  })

export const add = (shopBusinessRules: ShopBusinessRules): Promise<R<null>> =>
  request({
    url: `/shop/shop-business-rules/add`,
    data: shopBusinessRules,
    method: 'POST'
  })
export const update = (shopBusinessRules: ShopBusinessRules): Promise<R<null>> =>
  request({
    url: `/shop/shop-business-rules/update`,
    data: shopBusinessRules,
    method: 'PUT'
  })
export const queryShopRuleById = (ruleId: number): Promise<R<ShopBusinessRules>> =>
  request({
    url: `/shop/shop-business-rules/${ruleId}`,
    method: 'GET'
  })
export const remove = (ruleId: number): Promise<R<null>> =>
  request({
    url: `/shop/shop-business-rules/${ruleId}`,
    method: 'DELETE'
  })
